<%@ page pageEncoding="UTF-8"%>
<%@ include file="../commons/head.jsp"%>
<style type="text/css">
	.button{width: 100px;height: 30px;margin:3px 20px 3px 0;padding-top: 3px;}
	*{font-size: 14px;}
	.th td{font-weight: 700;}
	/* label{margin: 0 10px 0 18px;font-weight: 500;height: 25px;line-height: 25px;} */
     .control-label{padding: 0;font-weight: bold;}
     .diaform{margin: 20px auto;}
     h3{border-bottom:1px solid #ddd;padding-bottom:5px;width: 98%;  }
     .datagrid-view{border-top:1px solid #ddd;margin-top: 8px;}
     .datagrid-pager{border-bottom:1px solid #ccc;}
     hr{margin:15px 0 13px 0 ;background-color: #ddd;height: 1px;border: 0; width: 120%;}
     .jianju{margin-left:15px; }
     .datagrid-htable{
     font-weight:bold;
	/* background-color: #148CCA; */
	}
	.demo_line_01{
    
    margin: 5px 0;
    font-size: 50px;
    line-height: 1px;
    text-align: center;
	}
	.demo_line_01 .line{
	display:inline-block;
	   width:47.8%;
	   height:1px;
	   background:#ddd;
	   vertical-align:middle;
	   margin-top:8px;
	}
	.container-fluid{
	padding-left: 15px;
	}
	.datagrid-ftable td div{
		font-size: larger;
	
	}
	#pulldown{
		margin-top: 20px;
	}
	
/* td.datagrid-header-over{
	background: #148CCA !important;
} */
</style>
<title>角色修改</title>
<style type="text/css">
.datagrid-ftable {
	color: red;
	font-weight: bold;
}
.datagrid-body {
height:300px !important;
}
.datagrid-view {
height:360px !important;
}

</style>
<script src="${ctxStatic}/js/echarts.js"></script>
</head>
<body>
<div class="jianju">
<h3>角色修改</h3>

<div>
	<div class="row">
		<div class="form-inline">
			&nbsp;&nbsp;&nbsp;
			<div class="input-group">
				<span class="input-group-addon"><span style="color:red">*</span>角色名称</span>
				<input id=roleName class="form-control" value=${roleName } ><input type="hidden" id="hide" value=${roleId }>
			</div>
			<div class="input-group">
				<input id="save" type="button" class="btn btn-success" value="保存">
				<input id="return" type="button" class="btn btn-danger" value="返回">
			</div>	
	</div>
</div>
</body>
<script>
	$(function() {
		$("#save").click(
				function() {
					$.ajax({
						url:"${ctx}/selectRole/updateRole?roleId="+ $("#hide").val()+"&roleName="+$("#roleName").val(),
						contentType: "application/json; charset=utf-8",
						method:'get',
						data:"",
						success:function(data){
								if(data==1){
									alert("修改成功")
								}else if(data==2){
									alert("角色名不能为空")
								}else if(data==0){
									alert("角色名长度限制为50字")
								}else{
									alert("请先到角色查询页面选择角色")
								}}
					})
				})
	})
	//返回
$(function(){
	$("#return").click(function(){
		location.href="${ctx}/selectRole/s"
	})
})
</script>
</html>